<div class="main-content">
    <div class="section__content section__content--p20">
        <div class="container-fluid">
            <div class="row m-b-30">
                <div class="col-lg-12">
                    <div class="overview-wrap">
                        <h2 class="title-1">密码修改</h2>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-lg-12">
                    <div class="card">
                        <div class="card-header">
                            <strong>密码修改</strong>
                        </div>
                        <div class="card-body">
                            <form class="form-horizontal" role="form" name="form" id="form" method="post"
                                  data-bv-feedbackicons-valid="glyphicon glyphicon-ok"
                                  data-bv-feedbackicons-invalid="glyphicon glyphicon-remove"
                                  data-bv-feedbackicons-validating="glyphicon glyphicon-refresh"
                                  action="index.php?r=admin/admin/changepwd">
                                <input type="hidden" name="YII_CSRF_TOKEN"
                                       value="<?php echo Yii::app()->request->csrfToken; ?>"/>
                                <input type="hidden" value="<?php echo $userinfo['user_id']; ?>" name="user_id"/>

                                <div class="form-group">
                                    <label class=" form-control-label">旧密码</label>
                                    <input type="password" class="form-control" name="oldpasswd"/>
                                </div>

                                <div class="form-group">
                                    <label class=" form-control-label">登入密码</label>
                                    <input type="password" id="newpass" name="newpass" class="form-control"/>
                                </div>

                                <div class="form-group">
                                    <label class=" form-control-label">确认密码</label>
                                    <input type="password" id="newpass_confirm" name="newpass_confirm"
                                           class="form-control "/>
                                </div>

                                <div class="form-group">
                                    <button  type="submit" name="submit" id="submit" class="btn btn-primary btn-lg btn-block">保存</button>
                                </div>

                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<script>
    $(function () {
        initPage();
    });

    function initPage() {
        $('#form').bootstrapValidator();
        $('#form').ajaxForm({
            dataType: 'json',
            beforeSubmit: function (formData, jqForm, options) {
                return $('#form').data('bootstrapValidator').isValid();
            },
            success: function (res) {
                if (message(res)) {

                }
                $('#form').bootstrapValidator('disableSubmitButtons', false);
            }
        });
    }
</script>